package edu.upf.grupoe.p2ppicture.SearchEngine.implementations;

import edu.upf.grupoe.p2ppicture.SearchEngine.interfaces.SearchProfile;
import java.io.Serializable;
import java.util.List;
/**
 * This class represents a SearchProfile Object which is used in a GenericMessage
 * @author marc
 */
public class SearchProfileImpl implements SearchProfile, Serializable{

    private List<String> keywords = null;
    private String typeOfSearch = "";
    /**
     * This method sets the keywords used in a query
     * @param keywords List<String>
     */
    public void setKeywords(List<String> keywords) {
        this.keywords = keywords;
    }
    /**
     * This method sets the type of search that is going to be used in the database to obtain the information. By default: "normal".
     * @param typeOfSearch String
     */
    public void setTypeOfSearch(String typeOfSearch) {
        this.typeOfSearch = typeOfSearch;
    }
    /**
     * This method obtains the List of keywords of a query
     * @return List<String>
     */
    public List<String> getKeywords() {
        return keywords;
    }
    /**
     * This method returns the typeOfSearch set in a query.
     * @return String
     */
    public String getTypeOfSearch() {
        return typeOfSearch;
    }
    /**
     * This method adds a String keyword to a List of Keywords
     * @param keyword String
     */
    public void addKeyword(String keyword) {
        this.keywords.add(keyword);
    }
    /**
     * SearchProfileImpl Constructor
     * @param keywords List<String>
     * @param typeOfSearch String
     */
    public SearchProfileImpl(List<String> keywords, String typeOfSearch){
        this.keywords = keywords;
        this.typeOfSearch = typeOfSearch;
    }
}
